<%@page contentType="text/html" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="<%=application.getContextPath()%>/nresources/ued/css/all-src.css" type="text/css" rel="stylesheet"/>
    <title>用户登录信息</title>
    <%@include file="/WEB-INF/ibnms/common/jqgrid.jsp" %>
    <style type="text/css">
        select {
            width: auto;
        }
    </style>
</head>
<body>
<div class="form-wrapper">
    <div class="form-title">
        <span class="ttcorner"></span>

        <h3>
            <span class="text">用户登录信息</span>
        </h3>
    </div>
    <form name="theForm">
        <input type="hidden" name="userForm.DEPT_ID" value="${userForm.DEPT_ID}"/>
    </form>
    <div class="box-in">
    </div>
    <div class="title-style"><a class="fold-tip"></a></div>
    <div class="block02">
        <div class="title-style02">
            <input class="btn-style02" type="button" id="btn-back" value="返回">&nbsp;&nbsp;
        </div>
        <table id="gridTable">
        </table>
        <div id="gridPager">
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="<%=application.getContextPath()%>/njs/basd/common/commons.min.js"></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/njs/basd/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    $(function () {
        $(".title-style a.fold-tip").toggle(toggletip, toggletip);
        function toggletip() {
            if ($(this).attr("class").split("unfold-tip").length > 1) {
                $(this).removeClass("unfold-tip");
                $(this).parents().prev(".box-in").show("fast");
            } else {
                $(this).addClass("unfold-tip");
                $(this).parents().prev(".box-in").hide("fast");
            }
        }
    });

    $(function () {
        $("#gridTable").jqGrid({
            url: "<s:url action="loginListJson" namespace="/ibnms/report"/>",
            datatype: "json",
            mtype: "POST",
            height: "100%",
            autowidth: true,
            colNames: ['用户ID', '用户名', '登录时间', '登出时间', '部门'],
            colModel: [
                {name: 'LOGIN_ID', index: 'LOGIN_ID', hidden: true},
                {name: 'NAME', index: 'MODULE_NAME', sortable: false},
                {
                    name: 'START_TIME', index: 'START_TIME', sortable: false
                },
                {
                    name: 'END_TIME', index: 'END_TIME', sortable: false
                },
                {
                    name: 'DEPT_NAME', index: 'DEPT_NAME', sortable: false
                }
            ],
            sortable: false,
            viewrecords: true,
            rowNum: 10,
            rowList: [10, 20, 30],
            jsonReader: {
                root: 'rows',
                page: 'page',
                total: 'total',
                records: 'records',
                repeatitems: false,
                subgrid: {
                    root: 'rows',
                    page: 'page',
                    total: 'total',
                    records: 'records',
                    repeatitems: false
                }
            },
            pager: "#gridPager",
            hidegrid: true,
            multiselect: true,
            beforeRequest: function () {
                var postData = {
                    "queryRule": '${queryRule}',
                    "beginTime": '${beginTime}',
                    "endTime": '${endTime}',
                    "loginId": '${loginId}'
                };
                $.extend($("#gridTable").getGridParam("postData"), postData);
            }
        });
        $("#btn-back").click(function(){
           window.history.go(-1);
        });
    });
</script>
</html>
